<template>
  <BaiduMap
    class="map"
    style="display: flex; flex-direction: column; height: 734px"
    :zoom="19"
    :scroll-wheel-zoom="true"
    :center="childmessage"
    map-type="BMAP_HYBRID_MAP"
    ak="VMI7fuQnbCg9TwvIO2joHBTaYTG12s9e"
  >
    <BmMarker
      v-if="childmessage.lat"
      :position="childmessage"
      animation="BMAP_ANIMATION_BOUNCE"
      @click="infoWindowOpen"
    >
      <bminfowindow :show="show" @close="infoWindowClose" @open="infoWindowOpen">
        <p>位置信息</p>
        <p>{{ this.locations }}</p>
      </bminfowindow>
    </BmMarker>
  </BaiduMap>
</template>

<script>
export default {
  props: {
    childmessage: {
      type: Object,
      default() {
        return {}
      },
    },
    locations: {
      type: String,
      default() {
        return ''
      },
    },
  },
  data() {
    return {
      show: false,
      Arrs: {},
    }
  },
  methods: {
    infoWindowOpen() {
      this.show = true
    },
    infoWindowClose() {
      this.show = false
    },
  },
}
</script>

<style></style>
